#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 7;
const int MOD = 1e9 + 7;
int dp[MAXN][MAXN];
char mx[MAXN][MAXN];

int main(){
	int h,w;
	cin >> h >> w;
	for(int i = 1;i <= h;i++){
		for(int j = 1;j <= w;j++){
			cin >> mx[i][j];
		}
	}
	dp[1][1] = 1;
	for(int i = 1;i <= h;i++){
		for(int j = 1;j <= w;j++){
			if(mx[i][j] == '#'){
				dp[i][j] = 0;
				continue;
			}
			if(i > 1){
				dp[i][j] += dp[i - 1][j];
				dp[i][j] %= MOD;
			}
			if(j > 1){
				dp[i][j] += dp[i][j - 1];
				dp[i][j] %= MOD;
			}
		}
	}
	cout << dp[h][w] << "\n";
}